package com.xc.pattern.factory.simple;

import com.xc.pattern.factory.AliPay;
import com.xc.pattern.factory.Pay;
import com.xc.pattern.factory.WechatPay;

/**
 * @author xingchen
 * @description 简单工厂模式
 * @create 2022-08-18 21:35
 */
public class SimplePayFactory {


    public static Pay createPay(String payType) {
        if (payType == null) {
            return null;
        } else if (payType.equalsIgnoreCase("WECHAT PAY")) {
            return new WechatPay();
        } else if (payType.equalsIgnoreCase("ALIA PAY")) {
            return new AliPay();
        }
        //想拓展  直接编写更多
        return null;
    }

}
